package com.st.lwb;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.MotionEvent;
import android.view.animation.AlphaAnimation;
import android.widget.LinearLayout;

public class WelcomeActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
        
        LinearLayout splashLayout = (LinearLayout) findViewById(R.id.splashLayout);
        AlphaAnimation alphaAnimation = new AlphaAnimation(0.3f, 1.0f);
        alphaAnimation.setDuration(2000);
        splashLayout.setAnimation(alphaAnimation);
        splashLayout.startAnimation(alphaAnimation);
        
        new Handler().postDelayed(new Runnable() {
			
			@Override
			public void run() {
				Intent intent = new Intent(WelcomeActivity.this,HomeTabActivity.class);
				startActivity(intent);
				if(WelcomeActivity.this!=null)
					finish();
			}
		}, 1000);
    }

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		if (event.getAction() == MotionEvent.ACTION_DOWN) {
			Intent intent = new Intent(WelcomeActivity.this,HomeTabActivity.class);
			startActivity(intent);
			finish();
		}
		return super.onTouchEvent(event);
	}
}